
<div id="addnew_hotel_image"></div>
  <table>
    <tr>
      <td> 
        <%= link_to 'back', hotels_path, class: "btn btn btn-inverse", remote: true %>    
      </td>
    </tr>
  </table> <br/>
  <div id="hotel_images_table">
    <table class="table">
      <thead>
        <tr>
          <th style="text-align:center;"> Images </th>
          <th> Description </th>
          <th style="text-align:center;">Action</th>
        </tr>
      </thead>
      <tbody id="hotel_images">
        <% if @hotel_images.empty? %>
          <tr id="empty">
            <td>Empty</td>
          </tr>
        <% else %>
          <% @hotel_images.each do |hotel_image| %>
            <tr id="tr_<%= hotel_image.id %>">        
                <td class="text-center">
                  <%= image_tag hotel_image.image.url(:thumb) %>
                </td>
                <td>
                  <%= (hotel_image.description_eng.blank?)? "None" : hotel_image.description_eng %>
                </td>
                <td class="text-center"> 
                  <%= link_to 'Delete', {controller: 'hotel_images', action: 'destroy' , id: hotel_image.id , hid: params[:hid] }, method: :delete, remote: true, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
                </td>
            </tr>
          <% end %>
        <% end %>
      </tbody>
    </table>
    <div class="collection_paginator">
      <%#= will_paginate hotel_images %>
    </div>  
  </div>  
</div>

<div id="add_image" class="well">
  <div class="row-fluid">
    <div id="primary_form" class=" span12">
      <%= form_for(@hotel_image, :html => {remote: true, id: "form_hotel_image" }) do |f| %>           
          <%= f.text_field :hotel_id, {value: params[:hid]} %>
          <%= f.file_field :image, class: "checkbox" %>
          <%= f.text_area :description_eng, class: "dec_image", style: "width: 400px; height:25px;", :placeholder => "Image Description ..." %>
          <%= f.submit "Add Image", class: "btn btn-primary checkbox", style: "margin-left:30px;" %> 
      <% end %>
    </div>  
  </div> 
</div>

<div class="row-fluid ">
  <%#= link_to "Add More +", new_hotel_image_path, remote: true, class: "btn btn-danger" %>
</div>
